package com.blockmeta.bbs.minemodule.activity;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.blockmeta.bbs.businesslibrary.arouter.RouterPath;
import com.blockmeta.bbs.minemodule.R;
@Route(path = RouterPath.MINE_CARRIER_ACTIVITY)
public class MineCarrierActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mine_carrier);
        addFragment();
    }

    private void addFragment() {
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        Fragment fragment = (Fragment) ARouter.getInstance().build(RouterPath.MINE_FRAGMENT).navigation();
        if (fragment==null){return;}
        if (!fragment.isAdded()){
            transaction.add(R.id.fragment_container,fragment).commitAllowingStateLoss();
        }
    }
}
